<template>
  <el-card class="noticeDetails">
    <div class="notice-title">
      {{title}}
    </div>
    <el-card class="cfm-content" v-if="content" v-html="content"/>
    <el-card v-else class="cfm-content">
      你需要的内容失效了哦
    </el-card>
  </el-card>
</template>

<script>

import { getNoticeDetails } from '@/services/index/notice/notice'

export default {
  name: 'NoticeDetails',
  data () {
    return {
      noticeNumber: '',
      content: '',
      title: ''
    }
  },
  mounted () {
    this.noticeNumber = this.$route.params.noticeNumber
    this.getNoticeDetails()
  },
  created () {

  },
  methods: {
    getNoticeDetails () {
      const dataForm = {
        noticeNumber: this.noticeNumber
      }
      const data = JSON.stringify(dataForm)
      getNoticeDetails(data).then((res) => {
        if (res.code !== 10000) {
          this.$message.error('查看失败了呢 呜呜呜')
        }
        this.content = res.data.content
        this.title = res.data.title
      })
    }
  }
}
</script>

<style scoped lang="less">
@import "noticeDetails.less";
</style>
